package org.zdc.pivot.wtk;

class Insets 
{
	private var _top:Float;
	private var _bottom:Float;
	private var _left:Float;
	private var _right:Float;
	
	public static inline var TOP_KEY:String = "top";
	public static inline var LEFT_KEY:String = "left";
	public static inline var BOTTOM_KEY:String = "bottom";
	public static inline var RIGHT_KEY:String = "right";
	
	public static inline var NONE:Insets = new Insets(); 
	
	public function new(top:Float = 0, left:Float = 0, bottom:Float = 0, right:Float = 0) 
	{
		this.top = top;
		this.left = left;
		this.bottom = bottom;
		this.right = right;
	}
	
	public function equals(insets:Insets):Bool {
		var eq:Bool = false;
		if (insets != null) {
			eq = (top == insets.top &&
				  bottom == insets.bottom &&
				  left == insets.left &&
				  right == insets.right);
		}
		return eq;
	}
	
	private function get_top():Float 
	{
		return _top;
	}
	
	private function set_top(value:Float):Float 
	{
		return _top = value;
	}
	
	public var top(get_top, set_top):Float;
	
	private function get_bottom():Float 
	{
		return _bottom;
	}
	
	private function set_bottom(value:Float):Float 
	{
		return _bottom = value;
	}
	
	public var bottom(get_bottom, set_bottom):Float;
	
	private function get_left():Float 
	{
		return _left;
	}
	
	private function set_left(value:Float):Float 
	{
		return _left = value;
	}
	
	public var left(get_left, set_left):Float;
	
	private function get_right():Float 
	{
		return _right;
	}
	
	private function set_right(value:Float):Float 
	{
		return _right = value;
	}
	
	public var right(get_right, set_right):Float;
	
}